home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1996 #14 / Monster Media No. 14 (April 1996) (Monster Media, Inc.).ISO / games_d / deep815s.zip / HEXSPECS.DOC < prev    next >
Text File  |  1995-11-02  |  73KB  |  2,651 lines

  1.  
  2. HEXEN Specs v0.9                                                    Page 1
  3.  
  4.  
  5.  
  6.                      The Official Hexen Technical Specs
  7.                  Author: Ben Morris (bmorris@islandnet.com)
  8.                 Information from Raven provided by Ben Gokey
  9.  
  10.                                [Disclaimer]
  11.  
  12.         The text contained in this document is for informational
  13.         purposes only.  If you decide to use this information in any
  14.         way, neither id Software, Raven Software, nor Ben Morris
  15.         can be held responsible for any damages or losses (including,
  16.         but not limited to: dismembered bodily parts, telefrags and
  17.         lack of sleep) incurred by this information's use.  Although
  18.         this is an "Official" specification, some of the information
  19.         contained within might be old, or just plain typed in wrong.
  20.         You have been warned.
  21.  
  22.                                      !!!
  23.  
  24.     NB: This version of the specs, 0.9, is a preliminary release.  Most of
  25.         the information here is tried and true, but there's a good
  26.         chance there are errors in the file.  If something doesn't
  27.         look right, or really IS wrong, please contact me (Ben Morris)
  28.         at the address above.  Please do NOT contact me about new
  29.         versions of the specs; I will release the new versions when
  30.         they are ready.  Thanks.
  31.  
  32.         ** Set your tab width to 4.
  33.  
  34.  
  35.  
  36.  
  37.  
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.                                                                     Page 1
  56.  
  57. HEXEN Specs v0.9                                                    Page 2
  58.  
  59. ┌───┬───────────────────────────────────────────────────────────────────────
  60. │ ■ │ Table of Contents
  61. └───┘
  62.  
  63.     No, this isn't finished.
  64.  
  65.  
  66. ┌───┬───────────────────────────────────────────────────────────────────────
  67. │ ■ │ Definitions used in this File
  68. └───┘
  69.  
  70. Angle [0..255]  Used in "angle" parameters to Special types:
  71.  
  72.                 0       East            32      Northeast
  73.                 64      North           96      Northwest
  74.                 128     West            160     Southwest
  75.                 192     South           224     Southeast
  76.  
  77.                 * NOTE that this differs from DOOM/Heretic in that 45/90
  78.                   degree increments are not used.  However, this difference
  79.                   does _not_ apply for the angles used for the THINGS in
  80.                   map editing - they are the same as DOOM's (eg: 0 = East,
  81.                   90 = North, etc.)
  82.  
  83. Tics            Time unit of length 1/35 second.  So, 35 tics = 1 second.
  84.  
  85. Octics          Time unit of length 8 tics.  So, 8 octics = 1 second.
  86.  
  87.  
  88.  
  89.  
  90.  
  91.  
  92.  
  93.  
  94.  
  95.  
  96.  
  97.  
  98.  
  99.  
  100.  
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.                                                                     Page 2
  110.  
  111. HEXEN Specs v0.9                                                    Page 3
  112.  
  113. ┌───┬───────────────────────────────────────────────────────────────────────
  114. │ i │ About This File
  115. └───┘
  116.  
  117. This file was written for those who are interested in the inner workings of
  118. Hexen.  It doesn't contain playing tips or information on how to get Hexen
  119. working on your system.
  120.  
  121. This file is intended to be supplementary to Matt Fell's "Unofficial DOOM
  122. Specs", which probably came with your copy of DOOM or DOOM ][.  Wherever
  123. it's relevant, this file refers to a specific section in the DOOM specs (be
  124. sure you have version 1.666!), so it's a good idea to have a copy at hand.
  125.  
  126.  
  127. ┌───┬───────────────────────────────────────────────────────────────────────
  128. │ i │ Introduction to Hexen
  129. └───┘
  130.  
  131. Hexen is the sequel to Heretic, Raven Software's first collaboration with id
  132. Software.
  133.  
  134. [..]
  135.  
  136. Hexen's major difference from Heretic and DOOM is its programmability.  Hexen
  137. features a powerful script language that can be used to create a wide variety
  138. of in-game effects such as traps, puzzles and even earthquakes!
  139.  
  140. [...]
  141.  
  142.  
  143.  
  144.  
  145.  
  146.  
  147.  
  148.  
  149.  
  150.  
  151.  
  152.  
  153.  
  154.  
  155.  
  156.  
  157.  
  158.  
  159.  
  160.  
  161.  
  162.  
  163.                                                                     Page 3
  164.  
  165. HEXEN Specs v0.9                                                    Page 4
  166.  
  167. ┌─────┬─────────────────────────────────────────────────────────────────────
  168. │ 3-0 │ Hexen Data Structures
  169. └─────┘
  170.  
  171. This section outlines the format of the new data blocks in a Hexen map - the
  172. LINEDEF and THING structures.  These structures have changed from the
  173. versions used in DOOM and Heretic.
  174.  
  175. [DOOM Specs ref]
  176.  
  177.  
  178. [3-1] The Hexen LINEDEF structure
  179. ---------------------------------
  180.  
  181.     Offset      Size        Meaning
  182.     ---------------------------------------------------
  183.     0           word        the line's start-vertex
  184.     2           word        the line's end-vertex
  185.     4           word        line flags (see below)
  186.     6           byte        special type (see [Specials])
  187.     7         5 bytes       special arguments
  188.     12          word        the line's right sidedef number
  189.     14          word        the line's left sidedef number
  190.  
  191.  
  192. [3-1-1] Line Flags
  193. ------------------
  194.  
  195.     The following flags are starred with an asterisk if they're new for
  196.     Hexen:
  197.  
  198.     Bits        Meaning when Set
  199.     ---------------------------------------------------
  200.     0           impassable - the line cannot be crossed.
  201.     1           impassable to monsters only.
  202.     2           two-sided
  203.     3           upper texture is unpegged (drawn from top-down)
  204.     4           lower/middle texture is unpegged (drawn from bottom-up)
  205.     5           secret - the line appears as impassable on the automap.
  206.     6           sound can't travel through the line, but only
  207.                 for monsters' ears.
  208.     7           never draw the line on the auto-map, even with the
  209.                 map cheat enabled.
  210.     8           the line is always drawn on the auto-map, even if it
  211.                 hasn't been seen by the player.
  212.  
  213.   * 9           the line's special ([3-1]) is repeatable, ie: it can
  214.                 be activated more than once.
  215.   * 10..12      the line's special activation, ie: how the special is
  216.  
  217.                                                                     Page 4
  218.  
  219. HEXEN Specs v0.9                                                    Page 5
  220.  
  221.                 activated.
  222.  
  223.                 Value   Activated when...
  224.                 ---------------------------------------------
  225.                 0       Player crosses the line
  226.                 1       Player uses the line with the use key
  227.                 2       Monster crosses the line
  228.                 3       Projectile impacts the wall
  229.                 4       Player pushes the wall
  230.                 5       Projectile crosses the line
  231.  
  232.                 To get the special activation, use the following formula:
  233.  
  234.                 activation := (line.flags BITAND 0x1C00) BITSHIFTRIGHT 10
  235.  
  236.  
  237. [3-2] The Hexen THING structure
  238. -------------------------------
  239.  
  240.     Offset      Size        Meaning
  241.     ---------------------------------------------------
  242.   * 0           word        thing ID - used in scripts and specials to
  243.                             identify a THING or a set of THINGs.
  244.     2           word        x-position on the map
  245.     4           word        y-position on the map
  246.   * 6           word        starting altitude on the map - the THING
  247.                             is created at this altitude above the floor
  248.                             of the sector it's in when the map is entered,
  249.                             and is immediately subjected to gravity.
  250.     8           word        the angle the thing is facing when the map
  251.                             is entered.
  252.     10          word        the thing type (see [3-2-2].)
  253.   * 12          word        thing flags (see [3-2-1].)
  254.     14          byte        special type (see [Specials]).  a thing's
  255.                             special is activated when the thing is
  256.                             killed (Monster), destroyed (Tree, Urn, etc.),
  257.                             or picked up (Artifact, Puzzle Piece.)
  258.     15        5 bytes       special arguments
  259.  
  260.  
  261. [3-2-1] Thing Flags
  262. -------------------
  263.  
  264. The following flags are starred with an asterisk if they're new for
  265. Hexen:
  266.  
  267.     Bits        Meaning when Set
  268.     ---------------------------------------------------
  269.     0           the thing appears on the Easy skill settings (1-2)
  270.     1           the thing appears on the Normal skill setting (3)
  271.  
  272.                                                                     Page 5
  273.  
  274. HEXEN Specs v0.9                                                    Page 6
  275.  
  276.     2           the thing appears on the Hard skill settings (4-5)
  277.     3           the thing is deaf - it sits around until it's
  278.                 hurt, or until it sees a player.
  279.   * 4           the thing is dormant - it never wakes up until it's
  280.                 activated using the Thing_Activate() special.
  281.   * 5           the thing appears for the Fighter class.
  282.   * 6           the thing appears for the Cleric class.
  283.   * 7           the thing appears for the Mage class.
  284.   * 8           the thing appears in single-player games.
  285.   * 9           the thing appears in cooperative games.
  286.   * 10          the thing appears in deathmatch games.
  287.  
  288.  
  289. Each "thing appears" flag must be set for each condition under which the
  290. thing is to appear.  For multi-player games involving more than one
  291. class, a thing that is set for one of the classes involved will also appear
  292. for the other two classes in the game.
  293.  
  294. For example, if you set the three pieces of the Fighter's sword to appear
  295. for only the Fighter (bit 5 is set) and in Deathmatch (bit 10 is set),
  296. if a Mage or a Cleric is also playing, the pieces of the sword will be
  297. visible to them, too.
  298.  
  299.  
  300. [3-2-2] Thing Types
  301. -------------------
  302.  
  303. Creatures as well as some objects can be activated and/or deactivated with
  304. the ThingActivate and ThingDeactivate line specials.
  305.  
  306. Creatures will freeze when deactivated and resume when activated.
  307. Activation can also be used to bring a "dormant" creature to life.
  308.  
  309. If a creature has a special, that special will be activated upon its death.
  310. Also, if the creature is teleported away using the banishment device
  311. (teleport other), the special will be activated and then removed from the
  312. creature.
  313.  
  314.     Type      Name
  315.     -----------------------------------------------------------
  316.     1         Player_1_start
  317.     2         Player_2_start
  318.     3         Player_3_start
  319.     4         Player_4_start
  320.     11        Player_Deathmatch
  321.     14        Player_TeleportSpot
  322.  
  323.     10        2C_SerpentStaff
  324.     8010      2F_Axe
  325.     53        2M_ConeOfShards
  326.  
  327.                                                                     Page 6
  328.  
  329. HEXEN Specs v0.9                                                    Page 7
  330.  
  331.     8009      3C_Firestorm
  332.     123       3F_Hammer
  333.     8040      3M_Lightning
  334.     20        4C_1Shaft
  335.     19        4C_2Cross
  336.     18        4C_3Arc
  337.     16        4F_1Hilt
  338.     13        4F_2Crosspiece
  339.     12        4F_3Blade
  340.     23        4M_1Stick
  341.     22        4M_2Stub
  342.     21        4M_3Skull
  343.  
  344.     10110     A_Flechette
  345.     8003      A_BoostMana
  346.     8002      A_BootsOfSpeed
  347.     8041      A_Bracers
  348.     84        A_IconOfDefender
  349.     30        A_Porkelator
  350.     83        A_WingsOfWrath
  351.     32        A_HealingComplete (Urn)
  352.     82        A_HealingHefty (Flask)
  353.     81        A_HealingWimpy (Vial)
  354.     10120     A_HealRadius
  355.     8000      A_Repulsion
  356.     86        A_DarkServant
  357.     36        A_ChaosDevice
  358.     33        A_Torch
  359.     10040     A_Banishment
  360.  
  361.     8008      Ar_Amulet
  362.     8005      Ar_Armor
  363.     8007      Ar_Helmet
  364.     8006      Ar_Shield
  365.  
  366.     114       C_Bishop
  367.     107       C_Centaur
  368.     115       C_CentaurLeader
  369.     10101     C_ClericBoss
  370.     31        C_Demon
  371.     8080      C_Demon2
  372.     254       C_Dragon
  373.     10030     C_Ettin
  374.     10100     C_FighterBoss
  375.     10060     C_FireImp
  376.     112       C_Fly
  377.     10080     C_Heresiarch
  378.     8020      C_IceGuy
  379.     10200     C_Korax
  380.     10102     C_MageBoss
  381.  
  382.                                                                     Page 7
  383.  
  384. HEXEN Specs v0.9                                                    Page 8
  385.  
  386.     121       C_Serpent
  387.     120       C_SerpentLeader
  388.     34        C_Wraith
  389.     10011     C_Wraith2
  390.  
  391.     8032      K_AxeKey
  392.     8034      K_CastleKey
  393.     8031      K_CaveKey
  394.     8035      K_DungeonKey
  395.     8033      K_FireKey
  396.     8200      K_GoldKey
  397.     8037      K_RustyKey
  398.     8036      K_SilverKey
  399.     8030      K_SteelKey
  400.     8039      K_SwampKey
  401.     8038      K_WasteKey
  402.  
  403.     122       Mana_1
  404.     124       Mana_2
  405.     8004      ManaCombined
  406.  
  407.     3000      PO_Anchor
  408.     3001      PO_StartSpot
  409.     3002      PO_StartSpot_Crush
  410.  
  411.     1410      SE_Wind
  412.  
  413.     10225     Spawn_Bat
  414.     10000     Spawn_Fog
  415.     10001     Spawn_Fog_a
  416.     10002     Spawn_Fog_b
  417.     10003     Spawn_Fog_c
  418.     113       Spawn_Leaf
  419.  
  420.     10090     Spike_Down
  421.     10091     Spike_Up
  422.  
  423.     1403      SS_Creak
  424.     1408      SS_EarthCrack
  425.     1401      SS_Heavy
  426.     1407      SS_Ice
  427.     1405      SS_Lava
  428.     1402      SS_Metal
  429.     1409      SS_Metal2
  430.     1404      SS_Silent
  431.     1400      SS_Stone
  432.     1406      SS_Water
  433.  
  434.     9001      X_MapSpot
  435.     9013      X_MapSpotGravity
  436.  
  437.                                                                     Page 8
  438.  
  439. HEXEN Specs v0.9                                                    Page 9
  440.  
  441.  
  442.     8064      Z_ArmorSuit
  443.     77        Z_Banner
  444.     8100      Z_Barrel
  445.     8065      Z_Bell
  446.     8066      Z_BlueCandle
  447.     8061      Z_BrassBrazier
  448.     8103      Z_Bucket
  449.     119       Z_Candle
  450.     8069      Z_Cauldron
  451.     8070      Z_Cauldron_Unlit
  452.     8071      Z_Chain32
  453.     8072      Z_Chain64
  454.     8073      Z_ChainHeart
  455.     8074      Z_ChainLHook
  456.     8075      Z_ChainSHook
  457.     8077      Z_ChainSkull
  458.     8076      Z_ChainSpikeBall
  459.     17        Z_Chandelier
  460.     8063      Z_Chandelier_Unlit
  461.     8042      Z_FireBull
  462.     8043      Z_FireBull_Unlit
  463.     8060      Z_FireSkull
  464.     118       Z_GlitterBridge
  465.     10503     Z_LargeFlame_Permanent
  466.     10502     Z_LargeFlame_Timed
  467.     10501     Z_SmallFlame_Permanent
  468.     10500     Z_SmallFlame_Timed
  469.     140       Z_TeleportSmoke
  470.     116       Z_TwinedTorch
  471.     117       Z_TwinedTorch_Unlit
  472.     103       Z_VasePillar
  473.     54        Z_Wall_Torch_Lit
  474.     55        Z_Wall_Torch_Unlit
  475.     5         Z_WingedStatue
  476.     6         ZC_Rock1
  477.     7         ZC_Rock2
  478.     9         ZC_Rock3
  479.     15        ZC_Rock4
  480.     41        ZC_ShroomLarge
  481.     42        ZC_ShroomSmall1
  482.     44        ZC_ShroomSmall2
  483.     45        ZC_ShroomSmall3
  484.     52        ZC_StalactiteLarge
  485.     56        ZC_StalactiteMedium
  486.     57        ZC_StalactiteSmall
  487.     48        ZC_Stalagmite_Pillar
  488.     49        ZC_StalagmiteLarge
  489.     50        ZC_StalagmiteMedium
  490.     51        ZC_StalagmiteSmall
  491.  
  492.                                                                     Page 9
  493.  
  494. HEXEN Specs v0.9                                                    Page 10
  495.  
  496.     8062      ZF_DestructibleTree
  497.     8068      ZF_Hedge
  498.     8104      ZF_ShroomBoom
  499.     39        ZF_ShroomLarge1
  500.     40        ZF_ShroomLarge2
  501.     46        ZF_ShroomSmall1
  502.     47        ZF_ShroomSmall2
  503.     8101      ZF_Shrub1
  504.     8102      ZF_Shrub2
  505.     29        ZF_StumpBare
  506.     28        ZF_StumpBurned
  507.     24        ZF_TreeDead
  508.     25        ZF_TreeDestructible
  509.     80        ZF_TreeGnarled1
  510.     87        ZF_TreeGnarled2
  511.     78        ZF_TreeLarge1
  512.     79        ZF_TreeLarge2
  513.     111       ZG_BloodPool
  514.     71        ZG_CorpseHanging
  515.     61        ZG_CorpseKabob
  516.     108       ZG_CorpseLynched
  517.     109       ZG_CorpseNoHeart
  518.     110       ZG_CorpseSitting
  519.     62        ZG_CorpseSleeping
  520.     8067      ZG_IronMaiden
  521.     65        ZG_TombstoneBigCross
  522.     69        ZG_TombstoneBrianP
  523.     66        ZG_TombstoneBrianR
  524.     67        ZG_TombstoneCrossCircle
  525.     63        ZG_TombstoneRIP
  526.     64        ZG_TombstoneShane
  527.     68        ZG_TombstoneSmallCross
  528.     93        ZI_IceSpikeLarge
  529.     94        ZI_IceSpikeMedium
  530.     95        ZI_IceSpikeSmall
  531.     89        ZI_IcicleLarge
  532.     90        ZI_IcicleMedium
  533.     91        ZI_IcicleSmall
  534.     8502      ZM_CandleWeb
  535.     8509      ZM_CleaverMeat
  536.     8508      ZM_GobletSilver
  537.     8507      ZM_GobletSmall
  538.     8505      ZM_GobletSpill
  539.     8506      ZM_GobletTall
  540.     8504      ZM_LgCandle
  541.     8500      ZM_LgStein
  542.     104       ZM_Pot1
  543.     105       ZM_Pot2
  544.     106       ZM_Pot3
  545.     100       ZM_Rubble1
  546.  
  547.                                                                     Page 10
  548.  
  549. HEXEN Specs v0.9                                                    Page 11
  550.  
  551.     101       ZM_Rubble2
  552.     102       ZM_Rubble3
  553.     8503      ZM_SmCandle
  554.     8501      ZM_SmStein
  555.     8051      ZP_GargBrnzShort
  556.     8047      ZP_GargBrnzTall
  557.     8044      ZP_GargCorrode
  558.     76        ZP_GargIceShort
  559.     73        ZP_GargIceTall
  560.     8050      ZP_GargLavaBrtShort
  561.     8046      ZP_GargLavaBrtTall
  562.     8049      ZP_GargLavaDrkShort
  563.     8045      ZP_GargLavaDrkTall
  564.     74        ZP_GargPortalShort
  565.     72        ZP_GargPortalTall
  566.     8052      ZP_GargStlShort
  567.     8048      ZP_GargStlTall
  568.     88        ZS_Log
  569.     58        ZS_Moss1
  570.     59        ZS_Moss2
  571.     37        ZS_Stump1
  572.     38        ZS_Stump2
  573.     27        ZS_Tree1
  574.     26        ZS_Tree2
  575.     60        ZS_Vine
  576.     99        ZW_RockBlack
  577.     97        ZW_RockBrownLarge
  578.     98        ZW_RockBrownSmall
  579.     9003      ZZ_BigGem
  580.     9007      ZZ_Book1
  581.     9008      ZZ_Book2
  582.     9016      ZZ_CWeapon
  583.     9015      ZZ_FWeapon
  584.     9018      ZZ_Gear
  585.     9019      ZZ_Gear2
  586.     9020      ZZ_Gear3
  587.     9021      ZZ_Gear4
  588.     9006      ZZ_GemBlue1
  589.     9010      ZZ_GemBlue2
  590.     9005      ZZ_GemGreen1
  591.     9009      ZZ_GemGreen2
  592.     9012      ZZ_GemPedestal
  593.     9004      ZZ_GemRed
  594.     9017      ZZ_MWeapon
  595.     9002      ZZ_Skull
  596.     9014      ZZ_Skull2
  597.     9011      ZZ_WingedStatueNoSkull
  598.  
  599.  
  600.  
  601.  
  602.                                                                     Page 11
  603.  
  604. HEXEN Specs v0.9                                                    Page 12
  605.  
  606. ┌─────┬─────────────────────────────────────────────────────────────────────
  607. │ 4-0 │ Hexen Script Language
  608. └─────┘
  609.  
  610. The Hexen Script Language is called the "Action Code Script", or ACS.
  611.  
  612. Each map has an ACS file that contains the scripts specific to that map.  The
  613. scripts within it are identified using numbers that the general special
  614. ACS_Execute() uses.  A script itself can call the ACS_Execute() special
  615. (actually quite common), which will spawn another script that will run
  616. concurrently with the rest of the scripts.  A script can also be declared as
  617. OPEN, which will make it run automatically upon entering the map.  This is
  618. used for perpetual type effects, level initialization, etc.  The compiler
  619. takes the ACS file and produces and object file that is the last lump in the
  620. map WAD (BEHAVIOR).
  621.  
  622. To create a compiled ACS file from a text script, use the DOS command:
  623.  
  624.  c:\hexen> acs filename [enter]
  625.  
  626. This command will produce 'filename.o' from 'filename.acs'.  The contents of
  627. the output file (filename.o) can be directly used as the BEHAVIOR lump of the
  628. map it's used with.
  629.  
  630. Map scripts should start with #include "common.acs", which is just...
  631.  
  632. #include "specials.acs"
  633. #include "defs.acs"
  634. #include "wvars.acs"
  635.  
  636. The file "specials.acs" defines all the general specials.  These are used
  637. within scripts just like function calls.  The file "defs.acs" defines a
  638. bunch of constants that are used by the scripts.  The file "wvars.acs"
  639. defines all the world variables.  It needs to be included by all maps so
  640. they use consistent indexing.
  641.  
  642.  
  643. [4-1] Variables and their Scope
  644. --------------------------------
  645.  
  646. There is only one data type ACS, a 4 byte integer.  Use the keyword int to
  647. declare an integer variable.  You may also use the keyword str, it is
  648. synonymous with int.  It's used to indicate that you'll be using the
  649. variable as a string.  The compiler doesn't use string pointers, it uses
  650. string handles, which are just integers.
  651.  
  652. Declaring a variable is simple.  There are two "types" of variable - "str"
  653. and "int":
  654.  
  655.  
  656.                                                                     Page 12
  657.  
  658. HEXEN Specs v0.9                                                    Page 13
  659.  
  660.         str mystring;
  661.         int myint;
  662.  
  663.       or:
  664.  
  665.         str texture, sound;
  666.         int i, tid;
  667.  
  668. * Note: You can't assign a variable in its declaration; you must give it a
  669.   value in a different expression.
  670.  
  671. The SCOPE of a variable is one of World-scope, Map-scope, or Script-scope.
  672.  
  673.     - World-scope variables are global, and can be accessed in any map.
  674.       Hexen maintains [n] permanent globals, numbered 0-[n-1].  You must
  675.       assign one of the globals a name in order to access it, like this:
  676.  
  677.         world int 5:Grunt;
  678.  
  679.       This tells Hexen to reference world global number 5 whenever it
  680.       encounters the name "Grunt".
  681.  
  682.     - Map-scope variables are local to the current map.  They must be
  683.       declared outside of any script code, but without the world keyword.
  684.       These variables can't be accessed in any other map.
  685.  
  686.     - Script-scope variables are local to the current script - they
  687.       can't be accessed by any other script or map.
  688.  
  689. Here's some code that shows the declaration of all three scopes:
  690.  
  691.     world int 3:DungeonAccess; // World-scope
  692.  
  693.     int mapTimer; // Map-scope
  694.  
  695.     script 4 (void)
  696.     {
  697.         int x, y; // Script-scope
  698.  
  699.         ...
  700.     }
  701.  
  702.  
  703. [4-2] Language Structure
  704. ------------------------
  705.  
  706. Here is a quick reference manual type definition of the language.  It
  707. ends with a description of all the internal functions.
  708.  
  709.  
  710.  
  711.                                                                     Page 13
  712.  
  713. HEXEN Specs v0.9                                                    Page 14
  714.  
  715. [4-2-1] Keywords
  716. ----------------
  717.  
  718. The following identifiers are reserved for use as keywords, and may
  719. not be used otherwise:
  720.  
  721.   break
  722.   case
  723.   const
  724.   continue
  725.   default
  726.   define
  727.   do
  728.   else
  729.   goto
  730.   if
  731.   include
  732.   int
  733.   open
  734.   print
  735.   printbold
  736.   restart
  737.   script
  738.   special
  739.   str
  740.   suspend
  741.   switch
  742.   terminate
  743.   until
  744.   void
  745.   while
  746.   world
  747.  
  748. [4-2-2] Comments
  749. ----------------
  750.  
  751. Comments are ignored by the script compiler.
  752.  
  753. /*
  754.    This is a comment.
  755. */
  756.  
  757. int a; // And this is a comment
  758.  
  759.  
  760.  
  761. [4-2-3] World-variable definitions
  762. ----------------------------------
  763.  
  764. world int <constant-expression> : <identifier> ;
  765.  
  766.                                                                     Page 14
  767.  
  768. HEXEN Specs v0.9                                                    Page 15
  769.  
  770. world int <constant-expression> : <identifier> , ... ;
  771.  
  772.  
  773. [4-2-4] Map-variable definitions
  774. --------------------------------
  775.  
  776. Declares a variable local to the current map.
  777.  
  778. int <identifier> ;
  779. str <identifier> ;
  780. int <identifier> , ... ;
  781.  
  782.  
  783. [4-2-5] Include Directive
  784. -------------------------
  785.  
  786. Includes the source of the specified file and compiles it.
  787.  
  788. #include <string-literal>
  789.  
  790.  
  791. [4-2-5] Define Directive
  792. ------------------------
  793.  
  794. Replaces an identifier with a constant expression.
  795.  
  796. #define <identifier> <constant-expression>
  797.  
  798.  
  799. [4-2-6] Constant Expressions
  800. ----------------------------
  801.  
  802. <integer-constant>:
  803.  
  804. decimal      200
  805. hexadecimal  0x00a0, 0x00A0
  806. fixed point  32.0, 0.5, 103.329
  807. any radix    <radix>_digits
  808.  
  809.   binary        2_01001010
  810.   octal         8_072310
  811.   decimal       10_50025
  812.   hexadecimal   16_00a03f2
  813.  
  814.  
  815. [4-2-7] String Literals
  816. -----------------------
  817.  
  818. <string-literal>: "string"
  819.  
  820.  
  821.                                                                     Page 15
  822.  
  823. HEXEN Specs v0.9                                                    Page 16
  824.  
  825.  
  826. [4-2-6] Script Definitions
  827. --------------------------
  828.  
  829. To define a script:
  830.  
  831. <script-definition>:
  832.   script <constant-expression> ( <arglist> ) { <statement> }
  833.   script <constant-expression> OPEN { <statement> }
  834.  
  835. eg:
  836.  
  837. script 10 (void) { ... }
  838.  
  839. script 5 OPEN { ... }
  840.  
  841. * Note that OPEN scripts do not take arguments.
  842.  
  843.  
  844. [4-2-6] Statements
  845. ------------------
  846.  
  847. <statement>:
  848.   <declaration-statement>
  849.   <assignment-statement>
  850.   <compound-statement>
  851.   <switch-statement>
  852.   <jump-statement>
  853.   <selection-statement>
  854.   <iteration-statement>
  855.   <function-statement>
  856.   <linespecial-statement>
  857.   <print-statement>
  858.   <control-statement>
  859.  
  860.  
  861. [4-2-6-1] Declaration Statements
  862. --------------------------------
  863.  
  864. Delcaration statements create script variables.
  865.  
  866. <declaration-statement>:
  867.   int <variable> ;
  868.   int <variable> , <variable> , ... ;
  869.  
  870.  
  871. [4-2-6-1] Assignment Statements
  872. -------------------------------
  873.  
  874. Assigns an expression to a variable.
  875.  
  876.                                                                     Page 16
  877.  
  878. HEXEN Specs v0.9                                                    Page 17
  879.  
  880.  
  881. <assignment-statement>:
  882.   <variable> <assignment-operator> <expression> ;
  883.  
  884. <assignment-operator>:
  885.   =
  886.   +=
  887.   -=
  888.   *=
  889.   /=
  890.   %=
  891.  
  892. * Note: An assignment of the form V <op>= E is equivalent to V = V <op> E.
  893.   For example:
  894.  
  895.     A += 5;     is the same as
  896.     A = A + 5;
  897.  
  898. [4-2-6-2] Compound Statements
  899. -----------------------------
  900.  
  901. <compound-statement>:
  902.   { <statement-list> }
  903.  
  904. <statement-list>:
  905.   <statement> <statement> <...>
  906.  
  907.  
  908. [4-2-6-3] Switch Statements
  909. ---------------------------
  910.  
  911. A switch statement evaluates an integral expression and passes control to the
  912. code following the matched case.
  913.  
  914. <switch-statement>:
  915.  switch ( <expression> ) { <labeled-statement-list> }
  916.  
  917.   <labeled-statement>:
  918.     case <constant-expression> : <statement>
  919.     default : <statement>
  920.  
  921. Example:
  922.  
  923.     switch (a)
  924.     {
  925.     case 1:         // when a == 1
  926.         b = 1;      // .. this is executed,
  927.         break;      // and this breaks out of the switch().
  928.  
  929.     case 2:         // when a == 2
  930.  
  931.                                                                     Page 17
  932.  
  933. HEXEN Specs v0.9                                                    Page 18
  934.  
  935.         b = 8;      // .. this is executed,
  936.                     // but there is no break, so it continues to the next
  937.                     // case, even though a != 3.
  938.  
  939.     case 3:         // when a == 3
  940.         b = 666;    // .. this is executed,
  941.         break;      // and this breaks out of the switch().
  942.  
  943.     default:        // when none of the other cases match,
  944.         b = 777;    // .. this is executed.
  945.     }
  946.  
  947.     * Note for C users: While C only allows integral expressions in a switch
  948.       statement, ACS allows full expressions such as "a + 10".
  949.  
  950.  
  951. [4-2-6-4] Jump Statements
  952. -------------------------
  953.  
  954. A jump statement passes control to another portion of the script.
  955.  
  956. <jump-statement>:
  957.   continue ;
  958.   break ;
  959.   restart ;
  960.  
  961.  
  962. [4-2-6-5] Iteration Statements
  963. ------------------------------
  964.  
  965. <iteration-statement>:
  966.   while ( <expression> ) <statement>
  967.   until ( <expression> ) <statement>
  968.   do <statement> while ( <expression> ) ;
  969.   do <statement> until ( <expression> ) ;
  970.   for ( <assignment-statement> ; <expression> ; <assignment-statement> )
  971.     <statement>
  972.  
  973. The continue, break and restart keywords can be used in an iteration
  974. statement:
  975.  
  976.     - the continue keyword jumps to the end of the last <statement> in the
  977.       iteration-statement.  The loop continues.
  978.  
  979.     - the break keyword jumps right out of the iteration-statement.
  980.  
  981.  
  982. [4-2-6-6] Function Statements
  983. -----------------------------
  984.  
  985.  
  986.                                                                     Page 18
  987.  
  988. HEXEN Specs v0.9                                                    Page 19
  989.  
  990. A function statement calls a Hexen internal-function, or a Hexen
  991. linespecial-function.
  992.  
  993. <function-statement>:
  994.   <internal-function> | <linespecial-statement>
  995.  
  996. <internal-function>:
  997.   <identifier> ( <expression> , ... ) ;
  998.   <identifier> ( const : <constant-expression> , ... ) ;
  999.  
  1000. <linespecial-statement>:
  1001.   <linespecial> ( <expression> , ... ) ;
  1002.   <linespecial> ( const : <constant-expression> , ... ) ;
  1003.  
  1004.  
  1005. [4-2-6-7] Print Statements
  1006. --------------------------
  1007.  
  1008. <print-statement>:
  1009.   print ( <print-type> : <expression> , ... ) ;
  1010.   printbold ( <print-type> : <expression> , ... ) ;
  1011.  
  1012. <print-type>:
  1013.     s   string
  1014.     d   decimal
  1015.     c   constant
  1016.  
  1017.  
  1018. [4-2-6-8] Selection Statements
  1019. ------------------------------
  1020.  
  1021. <selection-statement>:
  1022.   if ( <expression> ) <statement>
  1023.   if ( <expression> ) <statement> else <statement>
  1024.  
  1025.  
  1026. [4-2-6-9] Control Statements
  1027. ----------------------------
  1028.  
  1029. <control-statement>:
  1030.   suspend ;         // suspends the script
  1031.   terminate ;       // terminates the script
  1032.  
  1033.  
  1034. [4-2-7] Internal Functions
  1035. --------------------------
  1036.  
  1037.  void tagwait(int tag);
  1038.  ----------------------
  1039.  
  1040.  
  1041.                                                                     Page 19
  1042.  
  1043. HEXEN Specs v0.9                                                    Page 20
  1044.  
  1045.   The current script is suspended until all sectors marked with
  1046.   <tag> are inactive.
  1047.  
  1048.  
  1049.  void polywait(int po);
  1050.  ----------------------
  1051.  
  1052.   The current script is suspended until the polyobj marked with
  1053.   <po> is incactive.
  1054.  
  1055.  
  1056.  void scriptwait(int script);
  1057.  ----------------------------
  1058.  
  1059.   The current script is suspended until the script specified by
  1060.   <script> has terminated.
  1061.  
  1062.  
  1063.  void delay(int ticks);
  1064.  ----------------------
  1065.  
  1066.   The current script is suspended for a time specified by <ticks>.
  1067.   A tick represents one cycle from a 35Hz timer.
  1068.  
  1069.  
  1070.  void changefloor(int tag, str flatname);
  1071.  ----------------------------------------
  1072.  
  1073.   The floor flat for all sectors marked with <tag> is changed to
  1074.   <flatname>.
  1075.  
  1076.  
  1077.  void changeceiling(int tag, str flatname);
  1078.  ------------------------------------------
  1079.  
  1080.   The ceiling flat for all sectors marked with <tag> is changed to
  1081.   <flatname>.
  1082.  
  1083.  
  1084.  int random(int low, int high);
  1085.  ------------------------------
  1086.  
  1087.   Returns a random number between <low> and <high>, inclusive.  The
  1088.   values for <low> and <high> range from 0 to 255.
  1089.  
  1090.  
  1091.  int lineside(void);
  1092.  -------------------
  1093.  
  1094.   Returns the side of the line the script was activated from.  Use
  1095.  
  1096.                                                                     Page 20
  1097.  
  1098. HEXEN Specs v0.9                                                    Page 21
  1099.  
  1100.   the macros LINE_FRONT and LINE_BACK, defined in "defs.acs".
  1101.  
  1102.  
  1103.  void clearlinespecial(void);
  1104.  ----------------------------
  1105.  
  1106.   The special of the line that activated the script is cleared.
  1107.  
  1108.  
  1109.  int playercount(void);
  1110.  ----------------------
  1111.  
  1112.   Returns the number of active players.
  1113.  
  1114.  
  1115.  int gametype(void);
  1116.  -------------------
  1117.  
  1118.   Returns the type of game being played:
  1119.    GAME_SINGLE_PLAYER
  1120.    GAME_NET_COOPERATIVE
  1121.    GAME_NET_DEATHMATCH
  1122.  
  1123.  
  1124.  int gameskill(void);
  1125.  --------------------
  1126.  
  1127.   Returns the skill of the game being played:
  1128.    SKILL_VERY_EASY
  1129.    SKILL_EASY
  1130.    SKILL_NORMAL
  1131.    SKILL_HARD
  1132.    SKILL_VERY_HARD
  1133.  
  1134.   Example:
  1135.    int a;
  1136.    a = gameskill();
  1137.  
  1138.    switch( gameskill() )
  1139.    {
  1140.    case SKILL_VERY_EASY:
  1141.     ...
  1142.    case SKILL_VERY_HARD:
  1143.     ...
  1144.    }
  1145.  
  1146.  
  1147.  int timer(void);
  1148.  ----------------
  1149.  
  1150.  
  1151.                                                                     Page 21
  1152.  
  1153. HEXEN Specs v0.9                                                    Page 22
  1154.  
  1155.   Returns the current leveltime in ticks.
  1156.  
  1157.  
  1158.  void sectorsound(str name, int volume);
  1159.  ---------------------------------------
  1160.  
  1161.   Plays a sound in the sector the line is facing.  <volume> has the
  1162.   range 0 to 127.
  1163.  
  1164.  
  1165.  void thingsound(int tid, str name, int volume);
  1166.  -----------------------------------------------
  1167.  
  1168.   Plays a sound at all things marked with <tid>.  <volume> has the
  1169.   range 0 to 127.
  1170.  
  1171.  
  1172.  void ambientsound(str name, int volume);
  1173.  ----------------------------------------
  1174.  
  1175.   Plays a sound that all players hear at the same volume.  <volume> has
  1176.   the range 0 to 127.
  1177.  
  1178.  
  1179.  void soundsequence(str name);
  1180.  -----------------------------
  1181.  
  1182.   Plays a sound sequence in the sector the line is facing.
  1183.  
  1184.  
  1185.  int thingcount(int type, int tid);
  1186.  ----------------------------------
  1187.  
  1188.   Returns a count of things in the world.  Use the thing type definitions
  1189.   in defs.acs for <type>.  Both <type> and <tid> can be 0 to force the
  1190.   counting to ignore that information.
  1191.  
  1192.   Examples:
  1193.  
  1194.   // Count all ettins that are marked with TID 28:
  1195.   c = thingcount(T_ETTIN, 28);
  1196.  
  1197.   // Count all ettins, no matter what their TID is:
  1198.   c = thingcount(T_ETTIN, 0);
  1199.  
  1200.   // Count all things with TID 28, no matter what their type is:
  1201.   c = thingcount(0, 28);
  1202.  
  1203.  
  1204.  void setlinetexture(int line, int side, int position, str texturename);
  1205.  
  1206.                                                                     Page 22
  1207.  
  1208. HEXEN Specs v0.9                                                    Page 23
  1209.  
  1210.  -----------------------------------------------------------------------
  1211.  
  1212.   Sets a texture on all lines identified by <line>.  A line is identified by
  1213.   giving it the special Line_SetIdentification in a map editor.
  1214.  
  1215.   <side>:
  1216.    SIDE_FRONT
  1217.    SIDE_BACK
  1218.   <position>:
  1219.    TEXTURE_TOP
  1220.    TEXTURE_MIDDLE
  1221.    TEXTURE_BOTTOM
  1222.  
  1223.   Examples:
  1224.  
  1225.   setlinetexture(14, SIDE_FRONT, TEXTURE_MIDDLE, "ice01");
  1226.   setlinetexture(3, SIDE_BACK, TEXTURE_TOP, "forest03");
  1227.  
  1228.  
  1229.  void setlineblocking(int line, int blocking);
  1230.  ---------------------------------------------
  1231.  
  1232.   Sets the blocking (impassable) flag on all lines identified by <line>.
  1233.    <blocking>:
  1234.     ON
  1235.     OFF
  1236.  
  1237.   Example:
  1238.  
  1239.   setlineblocking(22, OFF);
  1240.  
  1241.  
  1242.  void setlinespecial(int line, int special, int arg1, int arg2,
  1243.     int arg3, int arg4, int arg5);
  1244.  --------------------------------------------------------------
  1245.  
  1246.   Sets the line special and args on all lines identified by <line>.
  1247.  
  1248.  
  1249.  
  1250.  
  1251.  
  1252.  
  1253.  
  1254.  
  1255.  
  1256.  
  1257.  
  1258.  
  1259.  
  1260.  
  1261.                                                                     Page 23
  1262.  
  1263. HEXEN Specs v0.9                                                    Page 24
  1264.  
  1265. ┌─────┬─────────────────────────────────────────────────────────────────────
  1266. │ 5-0 │ Flats with special properties
  1267. └─────┘
  1268.  
  1269.     Lava        Lava does damage
  1270.     Water        Makes things sink
  1271.     Sludge        Makes things sink
  1272.     Ice            Changes friction
  1273.  
  1274.  
  1275.  
  1276.  
  1277.  
  1278.  
  1279.  
  1280.  
  1281.  
  1282.  
  1283.  
  1284.  
  1285.  
  1286.  
  1287.  
  1288.  
  1289.  
  1290.  
  1291.  
  1292.  
  1293.  
  1294.  
  1295.  
  1296.  
  1297.  
  1298.  
  1299.  
  1300.  
  1301.  
  1302.  
  1303.  
  1304.  
  1305.  
  1306.  
  1307.  
  1308.  
  1309.  
  1310.  
  1311.  
  1312.  
  1313.  
  1314.  
  1315.                                                                     Page 24
  1316.  
  1317. HEXEN Specs v0.9                                                    Page 25
  1318.  
  1319. ┌─────┬─────────────────────────────────────────────────────────────────────
  1320. │ 6-0 │ The MAPINFO lump
  1321. └─────┘
  1322.  
  1323.     This is a lump in the .WAD that gives attributes to each map.  This entry
  1324.     does not go with each map - there is only one MAPINFO lump in the entire
  1325.     IWAD.  If you include a MAPINFO lump in a PWAD, make sure it's got
  1326.     information for all the possible maps the player will be entering.
  1327.  
  1328.     map:        Number and name of map [1..60]
  1329.     warptrans:  Actual map number in case maps are not sequential [1..60]
  1330.     next:       Map to teleport to upon exit of timed deathmatch [1..60]
  1331.     cdtrack:    CD track to play during level
  1332.     cluster:    Defines what cluster level belongs to
  1333.     sky1:        Default sky texture; followed by speed
  1334.     sky2:       Alternate sky displayed in Sky2 sectors ; followed by speed
  1335.     doublesky:    parallax sky: sky2 behind sky1
  1336.     lightning:    Keyword indicating use of lightning on the level
  1337.                 flashes from sky1 to sky2 (see also: IndoorLightning special)
  1338.     fadetable:    Lump Name of fade table {fogmap}
  1339.  
  1340.     Example MapInfo entry:
  1341.  
  1342.         map 1 "Winnowing Hall"
  1343.         warptrans 1
  1344.         next 2
  1345.         cluster 1
  1346.         sky1 SKY2 2        ; 2 is the sky scroll speed
  1347.         sky2 SKY3 0        ; 0 means don't scroll sky
  1348.         lightning
  1349.         doublesky
  1350.         cdtrack 13
  1351.  
  1352.  
  1353. Note on "next" integer (for timed deathmatches):
  1354.  
  1355. In normal gameplay, there is no linear fashion in which the game
  1356. progresses from one level to another; you just go through a teleport
  1357. somewhere on a level, and it takes you to somewhere on another
  1358. level.  For -timer deathmatch, the game needs to know what level to
  1359. proceed to because it isn't always just the next higher level.
  1360.  
  1361. A note about the WARPTRANS keyword:  Maps are edited and named
  1362. MAPxx, where xx is a number from 01 to 63.  This is the number that
  1363. is used from within scripts when a map is referred to, and by the
  1364. MAP keyword in the MAPINFO lump.  However, the -warp option and the
  1365. warping cheat use a different set of numbers.  This different set of
  1366. numbers is set by the WARPTRANS keyword.  By default, the WARPTRANS
  1367. value is set to the same number as the map.  Our designers starting
  1368.  
  1369.                                                                     Page 25
  1370.  
  1371. HEXEN Specs v0.9                                                    Page 26
  1372.  
  1373. making maps with numbers that had big gaps between them, and then
  1374. made the scripts refer to these numbers, so we needed a way to pack
  1375. all the map numbers into a continuous stream for the -warp option.
  1376. Also, the accepted range for a WARPTRANS value is 1-31.  Makes it
  1377. easy when using DM.
  1378.  
  1379.  
  1380. Note on "cluster" integer:
  1381.  
  1382. The game maps are divided into clusters.  When you enter a new cluster, you 
  1383. can never again visit any of the levels from the previous cluster.  This 
  1384. makes it so each individual save game only needs to backup map archives for 
  1385. about 6-7 maps, and provides for a milestone marker of sorts for game play, 
  1386. like an episode -- a Hexen backdrop and some text are given at the end of 
  1387. each cluster.  If you don't enter a cluster, it defaults to 0.  The 
  1388. commercial IWAD separates its 31 maps into 5 clusters.
  1389.  
  1390.  
  1391.  
  1392.  
  1393.  
  1394.  
  1395.  
  1396.  
  1397.  
  1398.  
  1399.  
  1400.  
  1401.  
  1402.  
  1403.  
  1404.  
  1405.  
  1406.  
  1407.  
  1408.  
  1409.  
  1410.  
  1411.  
  1412.  
  1413.  
  1414.  
  1415.  
  1416.  
  1417.  
  1418.  
  1419.  
  1420.  
  1421.  
  1422.  
  1423.  
  1424.                                                                     Page 26
  1425.  
  1426. HEXEN Specs v0.9                                                    Page 27
  1427.  
  1428. ┌─────┬─────────────────────────────────────────────────────────────────────
  1429. │ 7-0 │ PolyObjects
  1430. └─────┘
  1431.  
  1432. Polyobjs are one-sided lines that are built somewhere else on the map, and
  1433. then later translated to the desired start spot on the map at level load.
  1434.  
  1435. In building polyobjs, two different line specials can be used to determine
  1436. the line drawing order:
  1437.  
  1438.     Polyobj_ExplicitLine(polyNumber, orderNumber, polyMirror, sound);
  1439.     Polyobj_StartLine(polyNumber, polyMirror, sound);
  1440.  
  1441. Each polyobj should have a unique polyNumber, which is used in poly line
  1442. specials to refer to a particular polyobj.
  1443.  
  1444. polyMirror refers to a second polyobj that will "mirror" all actions of the
  1445. first polyobj.  For instance, if a polyobj is rotated to the right by 90
  1446. degrees, then that polyobj's mirror will rotate left 90 degrees.  Note that
  1447. having two polyobjs mirror each other is not considered to be a good thing,
  1448. but in general won't cause problems because a poly can only do one particular
  1449. action at a time.  Meaning:  if that poly that rotated left by 90 degrees
  1450. then mirrored the right-turning polyobj, the right-turning poly would ignore
  1451. any attempt to rotate it again, as it would already be being acted upon.
  1452.  
  1453.     The last parameter to these specials refers to a particular sound type
  1454. that should play when the poly is moved/rotated.  See the section on
  1455. attaching sounds to a moving sector for more info.
  1456.  
  1457.  
  1458. Polyobj_StartLine():
  1459.  
  1460. A very basic special.  Place it on a particular polyobj line, and that line
  1461. will be the first line rendered on the polyobj.  The rendering order for all
  1462. other lines are determined by itterating through to the next line that has a
  1463. first point identical to the start line's second point.  The third line
  1464. rendered will be the next line that has a first point identical to the second
  1465. line's second point, and so on and so forth.  This method works well for
  1466. polyobjs that are convex, and has the advantage of leaving all but one line
  1467. free for other line specials.
  1468.  
  1469. Polyobj_ExplicitLine:
  1470.  
  1471. This special requires a bit more work to use.  Each line in the polyobj
  1472. defined using this special must use this line special.  Then, a value from
  1473. 1-255 should be placed in orderNumber.  This defines the rendering order for
  1474. the lines, with a 1 being the first line rendered, and so on.  Useful for
  1475. non-convex polyobjs, but has the disadvantage of utilizing all line specials
  1476. on the poly.
  1477.  
  1478.                                                                     Page 27
  1479.  
  1480. HEXEN Specs v0.9                                                    Page 28
  1481.  
  1482.  
  1483.  
  1484. [7-1] Polyobj Start Spots and Anchor Points
  1485. -------------------------------------------
  1486.  
  1487. Each polyobj must have an anchor point, and a startSpot.  The anchor is a
  1488. thing placed near the polyobj when it's created that defines the origin of
  1489. the polyobj, or the point in which it will rotate about.  The anchor (and all
  1490. polyobj lines) are directly translated to the polyobj startSpot.
  1491.  
  1492. Bottom line:  The anchor point is the point near the polyobj, and the
  1493. startSpot is the point on the actual map that defines the location of the
  1494. poly.
  1495.  
  1496. There are two different types of startSpots:  crushing and non-crushing.
  1497. Pretty obvious what the difference is:  if the poly strikes an object, it'll
  1498. first attempt to move it.  If that fails it will either try to damage the
  1499. object, or just stop moving depending upon the type of startSpot.
  1500.  
  1501. Please note that the ANGLE field of the startSpot and anchor points should be
  1502. equal to the polyNumber that was previously defined for that particular
  1503. polyobj.  The polyobj stuff was done before any of the TID/thing special code
  1504. was implimented, so Raven did this temporary hack, which turned permanent, as
  1505. the designers had already done a ton of polyobjs, and didn't want to have to
  1506. go back and replace them.
  1507.  
  1508.  
  1509. Appendixes:
  1510.  
  1511.     A.  List of Spawnable Objects
  1512.     B.  List of Activate/Deactivate Objects
  1513.     C.  List of arg requiring Objects
  1514.     D.  List of Sector Specials
  1515.     E.  List of Line Specials
  1516.     F.  List of Sector Sounds
  1517.     G.  Key Numbers
  1518.  
  1519.  
  1520.  
  1521.  
  1522.  
  1523.  
  1524.  
  1525.  
  1526.  
  1527.  
  1528.  
  1529.  
  1530.  
  1531.  
  1532.  
  1533.                                                                     Page 28
  1534.  
  1535. HEXEN Specs v0.9                                                    Page 29
  1536.  
  1537. ┌───┬─────────────────────────────────────────────────────────────────────
  1538. │ A │ List of Spawnable Objects
  1539. └───┘
  1540.  
  1541.     Use these identifiers for the Thing_Spawn() and Thing_SpawnNoFog()
  1542.     specials:
  1543.  
  1544.     T_NONE
  1545.     T_CENTAUR
  1546.     T_CENTAURLEADER
  1547.     T_DEMON
  1548.     T_ETTIN
  1549.     T_FIREGARGOYLE
  1550.     T_WATERLURKER
  1551.     T_WATERLURKERLEADER
  1552.     T_WRAITH
  1553.     T_WRAITHBURIED
  1554.     T_FIREBALL1
  1555.     T_MANA1
  1556.     T_MANA2
  1557.     T_ITEMBOOTS
  1558.     T_ITEMEGG
  1559.     T_ITEMFLIGHT
  1560.     T_ITEMSUMMON
  1561.     T_ITEMTPORTOTHER
  1562.     T_ITEMTELEPORT
  1563.     T_BISHOP
  1564.     T_ICEGOLEM
  1565.     T_BRIDGE
  1566.     T_DRAGONSKINBRACERS
  1567.     T_ITEMHEALTHPOTION
  1568.     T_ITEMHEALTHFLASK
  1569.     T_ITEMHEALTHFULL
  1570.     T_ITEMBOOSTMANA
  1571.     T_FIGHTERAXE
  1572.     T_FIGHTERHAMMER
  1573.     T_FIGHTERSWORD1
  1574.     T_FIGHTERSWORD2
  1575.     T_FIGHTERSWORD3
  1576.     T_CLERICSTAFF
  1577.     T_CLERICHOLY1
  1578.     T_CLERICHOLY2
  1579.     T_CLERICHOLY3
  1580.     T_MAGESHARDS
  1581.     T_MAGESTAFF1
  1582.     T_MAGESTAFF2
  1583.     T_MAGESTAFF3
  1584.     T_MORPHBLAST
  1585.     T_ROCK1
  1586.  
  1587.                                                                     Page 29
  1588.  
  1589. HEXEN Specs v0.9                                                    Page 30
  1590.  
  1591.     T_ROCK2
  1592.     T_ROCK3
  1593.     T_DIRT1
  1594.     T_DIRT2
  1595.     T_DIRT3
  1596.     T_DIRT4
  1597.     T_DIRT5
  1598.     T_DIRT6
  1599.     T_ARROW
  1600.     T_DART
  1601.     T_POISONDART
  1602.     T_RIPPERBALL
  1603.     T_STAINEDGLASS1
  1604.     T_STAINEDGLASS2
  1605.     T_STAINEDGLASS3
  1606.     T_STAINEDGLASS4
  1607.     T_STAINEDGLASS5
  1608.     T_STAINEDGLASS6
  1609.     T_STAINEDGLASS7
  1610.     T_STAINEDGLASS8
  1611.     T_STAINEDGLASS9
  1612.     T_STAINEDGLASS0
  1613.     T_BLADE
  1614.     T_ICESHARD
  1615.     T_FLAME_SMALL
  1616.     T_FLAME_LARGE
  1617.     T_MESHARMOR
  1618.     T_FALCONSHIELD
  1619.     T_PLATINUMHELM
  1620.     T_AMULETOFWARDING
  1621.     T_ITEMFLECHETTE
  1622.     T_ITEMTORCH
  1623.     T_ITEMREPULSION
  1624.     T_MANA3
  1625.     T_PUZZSKULL
  1626.     T_PUZZGEMBIG
  1627.     T_PUZZGEMRED
  1628.     T_PUZZGEMGREEN1
  1629.     T_PUZZGEMGREEN2
  1630.     T_PUZZGEMBLUE1
  1631.     T_PUZZGEMBLUE2
  1632.     T_PUZZBOOK1
  1633.     T_PUZZBOOK2
  1634.     T_METALKEY
  1635.     T_SMALLMETALKEY
  1636.     T_AXEKEY
  1637.     T_FIREKEY
  1638.     T_GREENKEY
  1639.     T_MACEKEY
  1640.     T_SILVERKEY
  1641.  
  1642.                                                                     Page 30
  1643.  
  1644. HEXEN Specs v0.9                                                    Page 31
  1645.  
  1646.     T_RUSTYKEY
  1647.     T_HORNKEY
  1648.     T_SERPENTKEY
  1649.     T_WATERDRIP
  1650.     T_TEMPSMALLFLAME
  1651.     T_PERMSMALLFLAME
  1652.     T_TEMPLARGEFLAME
  1653.     T_PERMLARGEFLAME
  1654.     T_DEMON_MASH
  1655.     T_DEMON2_MASH
  1656.     T_ETTIN_MASH
  1657.     T_CENTAUR_MASH
  1658.     T_THRUSTSPIKEUP
  1659.     T_THRUSTSPIKEDOWN
  1660.     T_FLESH_DRIP1
  1661.     T_FLESH_DRIP2
  1662.     T_SPARK_DRIP
  1663.  
  1664.  
  1665.  
  1666.  
  1667.  
  1668.  
  1669.  
  1670.  
  1671.  
  1672.  
  1673.  
  1674.  
  1675.  
  1676.  
  1677.  
  1678.  
  1679.  
  1680.  
  1681.  
  1682.  
  1683.  
  1684.  
  1685.  
  1686.  
  1687.  
  1688.  
  1689.  
  1690.  
  1691.  
  1692.  
  1693.  
  1694.  
  1695.  
  1696.  
  1697.                                                                     Page 31
  1698.  
  1699. HEXEN Specs v0.9                                                    Page 32
  1700.  
  1701. ┌───┬─────────────────────────────────────────────────────────────────────
  1702. │ B │ List of Activateable/Deactivateable Objects
  1703. └───┘
  1704.  
  1705.     Activatable:
  1706.         MT_ZTWINEDTORCH                Lights torch
  1707.         MT_ZTWINEDTORCH_UNLIT        Lights torch
  1708.         MT_ZWALLTORCH                Lights torch
  1709.         MT_ZWALLTORCH_UNLIT            Lights torch
  1710.         MT_ZGEMPEDESTAL                Makes gem appear
  1711.         MT_ZWINGEDSTATUENOSKULL     Makes skull appear in hands
  1712.         MT_THRUSTFLOOR_UP           Raises thrust spike (if lowered)
  1713.         MT_THRUSTFLOOR_DOWN         Raises thrust spike
  1714.         MT_ZFIREBULL                Lights flames
  1715.         MT_ZFIREBULL_UNLIT            Lights flames
  1716.         MT_ZBELL                    Rings bell
  1717.         MT_ZCAULDRON                Lights flames
  1718.         MT_ZCAULDRON_UNLIT            Lights flames
  1719.         MT_FLAME_SMALL                Ignites flame
  1720.         MT_FLAME_LARGE                Ignites flame
  1721.         MT_BAT_SPAWNER              Start bat spawning
  1722.  
  1723.     Deactivatable:
  1724.         MT_ZTWINEDTORCH                Extinguish torch
  1725.         MT_ZTWINEDTORCH_UNLIT        Extinguish torch
  1726.         MT_ZWALLTORCH                Extinguish torch
  1727.         MT_ZWALLTORCH_UNLIT            Extinguish torch
  1728.         MT_THRUSTFLOOR_UP           Lower thrust spike
  1729.         MT_THRUSTFLOOR_DOWN         Lower thrust spike
  1730.         MT_ZFIREBULL                Extinguish torch
  1731.         MT_ZFIREBULL_UNLIT            Extinguish torch
  1732.         MT_ZCAULDRON                Extinguish torch
  1733.         MT_ZCAULDRON_UNLIT            Extinguish torch
  1734.         MT_FLAME_SMALL                Extinguish torch
  1735.         MT_FLAME_LARGE                Extinguish torch
  1736.         MT_BAT_SPAWNER                Stop bat spawning
  1737.  
  1738.  
  1739.  
  1740.  
  1741.  
  1742.  
  1743.  
  1744.  
  1745.  
  1746.  
  1747.  
  1748.  
  1749.  
  1750.  
  1751.                                                                     Page 32
  1752.  
  1753. HEXEN Specs v0.9                                                    Page 33
  1754.  
  1755. ┌───┬─────────────────────────────────────────────────────────────────────
  1756. │ C │ List of THINGS that require arguments
  1757. └───┘
  1758.  
  1759.     These THINGS ignore their special types, and use the arg0..arg5 fields
  1760.     for their own purposes:
  1761.  
  1762.         Type: 10225        Bat Spawner
  1763.             arg0:   frequency of spawn (1=fastest, 10=slowest)
  1764.             arg1:    spread angle (0..255)
  1765.             arg2:    unused
  1766.             arg3:    duration of bats (in octics)
  1767.             arg4:   turn amount per move (in degrees [0..255])
  1768.  
  1769.         Type: 10000        Fog Spawner
  1770.             arg0:    movement speed [0..10] (10 == fastest)
  1771.             arg1:   spread angle [0..128] (128 == 180 degrees)
  1772.             arg2:    Frequency of spawn [1..10] (1 == fastest)
  1773.             arg3:    Fog Lifetime [0..255] (5 == 1 second)
  1774.             arg4:    unused
  1775.  
  1776.         Type: 10001        Fog Patch Small
  1777.             arg0:    movement speed [0..10] (10 == fastest)
  1778.             arg1:    unused
  1779.             arg2:    unused
  1780.             arg3:    Fog Lifetime [0..255] (5 == 1 second)
  1781.             arg4:    Boolean: (0 == not moving)
  1782.  
  1783.         Type: 10002        Fog Patch Medium
  1784.             arg0:    movement speed [0..10] (10 == fastest)
  1785.             arg1:    unused
  1786.             arg2:    unused
  1787.             arg3:    Fog Lifetime [0..255] (5 == 1 second)
  1788.             arg4:    Boolean: (0 == not moving)
  1789.  
  1790.         Type: 10003        Fog Patch Large
  1791.             arg0:    movement speed [0..10] (10 == fastest)
  1792.             arg1:    unused
  1793.             arg2:    unused
  1794.             arg3:    Fog Lifetime [0..255] (5 == 1 second)
  1795.             arg4:    Boolean: (0 == not moving)
  1796.  
  1797.         Type: 254        Dragon Lich
  1798.             arg0:    TID of possible destination (required)
  1799.             arg1:    TID of possible destination (optional)
  1800.             arg2:    TID of possible destination (optional)
  1801.             arg3:    TID of possible destination (optional)
  1802.             arg4:    TID of possible destination (optional)
  1803.  
  1804.  
  1805.                                                                     Page 33
  1806.  
  1807. HEXEN Specs v0.9                                                    Page 34
  1808.  
  1809.             The dragon lich also requires mapspots placed around the map with
  1810.             its args containing TIDs of possible destinations, making up to 5
  1811.             destinations possible from each position.  The choice of next
  1812.             destination is random.  Note that the dragon lich's first
  1813.             destination is the first thing that it can locate that has a TID
  1814.             identical to it's own.
  1815.  
  1816.         Type: 10200        Korax
  1817.             TIDs:
  1818.                 245    Korax's mapthing
  1819.                 249 Teleport destination (MapSpots)
  1820.             Scripts:
  1821.                 249 Run when korax health falls below half
  1822.                 250-254 Randomly run by korax as commands
  1823.                 255    Run upon death of korax
  1824.  
  1825.  
  1826.  
  1827.  
  1828.  
  1829.  
  1830.  
  1831.  
  1832.  
  1833.  
  1834.  
  1835.  
  1836.  
  1837.  
  1838.  
  1839.  
  1840.  
  1841.  
  1842.  
  1843.  
  1844.  
  1845.  
  1846.  
  1847.  
  1848.  
  1849.  
  1850.  
  1851.  
  1852.  
  1853.  
  1854.  
  1855.  
  1856.  
  1857.  
  1858.  
  1859.  
  1860.                                                                     Page 34
  1861.  
  1862. HEXEN Specs v0.9                                                    Page 35
  1863.  
  1864. ┌───┬─────────────────────────────────────────────────────────────────────
  1865. │ D │ Sector Specials
  1866. └───┘
  1867.  
  1868.     The following numbers are used in the sector.type field [see DOOM
  1869.     specs.]:
  1870.  
  1871.     1    Light_Phased
  1872.     2    LightSequenceStart
  1873.     3    LightSequenceSpecial1
  1874.     4   LightSequenceSpecial2
  1875.  
  1876.         These specials deal with phased lightning ("moving lights").  Two
  1877.         different ways to go about doing phased lighting:  automatic, or
  1878.         by-hand.  The automatic method is (obviously) more convenient, but
  1879.         the by-hand method is more flexible.  Light_Phased is the by-hand
  1880.         special.  Place it on a sector, then set the sector's lightlevel to a
  1881.         phase index (0-63).  As you place the special on nearby sectors,
  1882.         increment the index for each sector.
  1883.  
  1884.         Or, to use the LightSequence specials, just place the LightSequence
  1885.         special on a sector.  Then, for each additional sector, alternate
  1886.         between LightSequenceSpecial1 & LightSequenceSpecial2.
  1887.  
  1888.         For instance, if you wanted phased lightning to flow up a staircase,
  1889.         you could either place Light_Phased on each step, and change the
  1890.         phase index (lightlevel) accordingly.  Or, you could place
  1891.         LightSequenceStart on the bottom step (and set that step's lightlevel
  1892.         to something mid-ranged:  80-128 are pretty nice values), and then
  1893.         let the game calculate the phase indices for each step by placing the
  1894.         LightSequenceSpecial specials on all other steps.  Note that for the
  1895.         LightSequenceSpecial specials to have proper lighting, set their
  1896.         lightlevels to zero, which causes it to use the previous sector's
  1897.         lightlevel.  Hence, that "nice value" which was placed on the first
  1898.         step will iterate through all the other steps.  If a step's
  1899.         lightlevel is not zero, then that value will filter down to all other
  1900.         steps after it.
  1901.  
  1902.     26    Stairs_Special1
  1903.     27    Stairs_Special2
  1904.         Used by action specials that build stairs.
  1905.  
  1906.     199    Light_IndoorLightning1
  1907.         Dimmer effect during lightning flash.  Used for indoor areas, which
  1908.         are normally not affected by lightning.
  1909.  
  1910.     198 Light_IndoorLightning2
  1911.         Same as 1, but brighter.
  1912.  
  1913.  
  1914.                                                                     Page 35
  1915.  
  1916. HEXEN Specs v0.9                                                    Page 36
  1917.  
  1918.     200    Sky2
  1919.         Use the alternate sky specified in the mapinfo lump.
  1920.  
  1921.     201    Scroll_North_Slow
  1922.     202    Scroll_North_Medium
  1923.     203    Scroll_North_Fast
  1924.     204    Scroll_East_Slow
  1925.     205    Scroll_East_Medium
  1926.     206    Scroll_East_Fast
  1927.     207    Scroll_South_Slow
  1928.     208    Scroll_South_Medium
  1929.     209    Scroll_South_Fast
  1930.     210    Scroll_West_Slow
  1931.     211    Scroll_West_Medium
  1932.     212    Scroll_West_Fast
  1933.     213    Scroll_NorthWest_Slow
  1934.     214    Scroll_NorthWest_Medium
  1935.     215    Scroll_NorthWest_Fast
  1936.     216    Scroll_NorthEast_Slow
  1937.     217    Scroll_NorthEast_Medium
  1938.     218    Scroll_NorthEast_Fast
  1939.     219    Scroll_SouthEast_Slow
  1940.     220    Scroll_SouthEast_Medium
  1941.     221    Scroll_SouthEast_Fast
  1942.     222    Scroll_SouthWest_Slow
  1943.     223    Scroll_SouthWest_Medium
  1944.     224    Scroll_SouthWest_Fast
  1945.  
  1946.         These all scroll floor flats in their respective directions.  They
  1947.         also move any objects in that direction.
  1948.  
  1949.  
  1950.  
  1951.  
  1952.  
  1953.  
  1954.  
  1955.  
  1956.  
  1957.  
  1958.  
  1959.  
  1960.  
  1961.  
  1962.  
  1963.  
  1964.  
  1965.  
  1966.  
  1967.  
  1968.  
  1969.                                                                     Page 36
  1970.  
  1971. HEXEN Specs v0.9                                                    Page 37
  1972.  
  1973. ┌───┬─────────────────────────────────────────────────────────────────────
  1974. │ E │ Action Specials
  1975. └───┘
  1976.  
  1977.     These are the specials found in the THING.special and LINEDEF.special
  1978.     fields.
  1979.  
  1980.  
  1981.     Floor and Ceiling Specials
  1982.     --------------------------
  1983.     20:Floor_LowerByValue / tag / speed / height / arg4 / arg5
  1984.         tag:        tag of affected sector
  1985.         speed:        speed of move [0..255]
  1986.         height:        relative height of move in pixels
  1987.  
  1988.             Moves the floor of all sectors identified by 'tag'.
  1989.  
  1990.     21:Floor_LowerToLowest / tag / speed / arg3 / arg4 / arg5
  1991.         tag:        tag of affected sector
  1992.         speed:        speed of move [0..255]
  1993.  
  1994.             Lowers floor to lowest adjacent sectors' floor.
  1995.  
  1996.     22:Floor_LowerToNearest / tag / speed / arg3 / arg4 / arg5
  1997.         tag:        tag of affected sector
  1998.         speed:        speed of move [0..255]
  1999.  
  2000.             Lowers floor to next lower adjacent sector's floor.
  2001.  
  2002.     23:Floor_RaiseByValue / tag / speed / height / arg4 / arg5
  2003.         tag:        tag of affected sector
  2004.         speed:        speed of move [0..255]
  2005.         height:        relative height of move in pixels
  2006.  
  2007.             Moves the floor of all sectors identified by 'tag'.
  2008.  
  2009.     24:Floor_RaiseToHighest / tag / speed / arg3 / arg4 / arg5
  2010.         tag:        tag of affected sector
  2011.         speed:        speed of move [0..255]
  2012.  
  2013.             Raises floor to highest adjacent sectors' floor.
  2014.  
  2015.     25:Floor_RaiseToNearest / tag / speed / arg3 / arg4 / arg5
  2016.         tag:        tag of affected sector
  2017.         speed:        speed of move [0..255]
  2018.  
  2019.             Raises floor to next higher adjacent sector's floor.
  2020.  
  2021.     28:Floor_RaiseAndCrush / tag / speed / crush / arg4 / arg5
  2022.  
  2023.                                                                     Page 37
  2024.  
  2025. HEXEN Specs v0.9                                                    Page 38
  2026.  
  2027.         tag:        tag of affected sector
  2028.         speed:        speed of move [0..255]
  2029.         crush:        damage done by crush
  2030.  
  2031.             Raises floor to ceiling and does crushing damage.
  2032.  
  2033.     35:Floor_RaiseByValueTimes8 / tag / speed / height / arg4 / arg5
  2034.         tag:        tag of affected sector
  2035.         speed:        speed of move [0..255]
  2036.         height:        relative height of move in 8 pixel units
  2037.  
  2038.             Raises the floor in increments of 8 units.
  2039.  
  2040.     36:Floor_LowerByValueTimes8 / tag / speed / height / arg4 / arg5
  2041.         tag:        tag of affected sector
  2042.         speed:        speed of move [0..255]
  2043.         height:        relative height of move in 8 pixel units
  2044.  
  2045.             Lowers the floor in increments of 8 units.
  2046.  
  2047.     46:Floor_CrushStop / tag / arg2 / arg3 / arg4 / arg5
  2048.         tag:        tag of affected sector
  2049.  
  2050.             Turns off a crushing floor.
  2051.  
  2052.     66:Floor_LowerInstant / tag / arg2 / height / arg4 / arg5
  2053.         tag:        tag of affected sector
  2054.         height:        relative height in units of 8 pixels
  2055.  
  2056.             Moves the floor down instantly by a specified amount.
  2057.  
  2058.     67:Floor_RaiseInstant / tag / arg2 / height / arg4 / arg5
  2059.         tag:        tag of affected sector
  2060.         height:        relative height in units of 8 pixels
  2061.  
  2062.             Moves the floor up instantly by a specified amount.
  2063.  
  2064.     68:Floor_MoveToValueTimes8 / tag / speed / height / negative / arg5
  2065.         tag:        tag of affected sector
  2066.         speed:        speed of move
  2067.         height:     absolute value in 8 pixel units of destination height
  2068.         negative:   boolean (true if height is negative)
  2069.  
  2070.             Move floor to an absolute height.
  2071.  
  2072.     40:Ceiling_LowerByValue / tag / speed / height / arg4 / arg5
  2073.         tag:        tag of affected sector
  2074.         speed:        speed of move
  2075.         height:        relative height of move in pixels
  2076.  
  2077.  
  2078.                                                                     Page 38
  2079.  
  2080. HEXEN Specs v0.9                                                    Page 39
  2081.  
  2082.             Relative ceiling move.
  2083.  
  2084.     41:Ceiling_RaiseByValue / tag / speed / height / arg4 /arg5
  2085.         tag:        tag of affected sector
  2086.         speed:        speed of move
  2087.         height:        relative height of move in pixels
  2088.  
  2089.             Relative ceiling move.
  2090.  
  2091.     42:Ceiling_CrushAndRaise / tag / speed / crush / arg4 / arg5
  2092.         tag:        tag of affected sector
  2093.         speed:        speed of move
  2094.         crush:        damage of crush
  2095.  
  2096.             Lowers ceiling to crush and raises (continual until stopped)
  2097.  
  2098.     43:Ceiling_LowerAndCrush / tag / speed / crush / arg4 / arg5
  2099.         tag:        tag of affected sector
  2100.         speed:        speed of move
  2101.         crush:        damage of crush
  2102.  
  2103.             Lowers ceiling to floor and stops.
  2104.  
  2105.     44:Ceiling_CrushStop / tag / arg2 / arg3 / arg4 / arg5
  2106.         tag:        tag of affected sector
  2107.  
  2108.             Stop a crushing ceiling.
  2109.  
  2110.     45:Ceiling_CrushRaiseAndStay / tag / speed / crush / arg4 / arg5
  2111.         tag:        tag of affected sector
  2112.         speed:        speed of move
  2113.         crush:        damage of crush
  2114.  
  2115.             Lowers ceiling to crush, raises and stays.
  2116.  
  2117.     69:Ceiling_MoveToValueTimes8 / tag / speed / height / negative / arg5
  2118.         tag:        tag of affected sector
  2119.         speed:        speed of move
  2120.         height:     absolute value in 8 pixel units of destination height
  2121.         negative:    boolean (true if height is negative)
  2122.  
  2123.             Moves ceiling to absolute height.
  2124.  
  2125.     95:FloorAndCeiling_LowerByValue / tag / speed / height / arg4 / arg5
  2126.         tag:        tag of affected sector
  2127.         speed:        speed of move
  2128.         height:     absolute value in 8 pixel units of destination height
  2129.  
  2130.             Relative move of both floor and ceiling.
  2131.  
  2132.  
  2133.                                                                     Page 39
  2134.  
  2135. HEXEN Specs v0.9                                                    Page 40
  2136.  
  2137.     96:FloorAndCeiling_RaiseByValue / tag / speed / height / arg4 / arg5
  2138.         tag:        tag of affected sector
  2139.         speed:        speed of move
  2140.         height:     absolute value in 8 pixel units of destination height
  2141.  
  2142.             Relative move of both floor and ceiling.
  2143.  
  2144.     60:Plat_PerpetualRaise / tag / speed / delay / arg4 / arg5
  2145.         tag:        tag of affected sector
  2146.         speed:        speed of move
  2147.         delay:        delay before reversing direction
  2148.  
  2149.             Continually raises and lowers platform.
  2150.  
  2151.     61:Plat_Stop / tag / arg2 / arg3 / arg4 / arg5
  2152.         tag:        tag of affected sector
  2153.  
  2154.             Stops a PerpectualRaise platform.
  2155.  
  2156.     62:Plat_DownWaitUpStay / tag / speed / delay / arg4 / arg5
  2157.         tag:        tag of affected sector
  2158.         speed:        speed of move
  2159.         delay:        delay before reversing direction
  2160.  
  2161.             One cycle of lowering and raising.
  2162.  
  2163.     63:Plat_DownByValue / tag / speed / delay / height / arg5
  2164.         tag:        tag of affected sector
  2165.         speed:        speed of move
  2166.         delay:        delay before reversing direction
  2167.         height:        relative height in 8 pixel units
  2168.  
  2169.             Relative platform move.
  2170.  
  2171.     64:Plat_UpWaitDownStay / tag / speed / delay / arg4 / arg5
  2172.         tag:        tag of affected sector
  2173.         speed:        speed of move
  2174.         delay:        delay before reversing direction
  2175.  
  2176.             One cycle of raising and lowering.
  2177.  
  2178.     65:Plat_UpByValue / tag / speed / delay / height / arg5
  2179.         tag:        tag of affected sector
  2180.         speed:        speed of move
  2181.         delay:        delay before reversing direction
  2182.         height:        relative height
  2183.  
  2184.             Relative platform move.
  2185.  
  2186.     29:Pillar_Build / tag / speed / height / arg4 / arg5
  2187.  
  2188.                                                                     Page 40
  2189.  
  2190. HEXEN Specs v0.9                                                    Page 41
  2191.  
  2192.         tag:        tag of affected sector
  2193.         speed:        speed of build
  2194.         height:        height (relative to floor) where
  2195.  
  2196.             Makes the floor meet the ceiling.
  2197.  
  2198.     30:Pillar_Open / tag / speed / f_height / c_height / arg5
  2199.         tag:        tag of affected sector
  2200.         speed:        speed of build
  2201.         f_height:    relative height to move floor down
  2202.         c_height:    relative height to move ceiling up
  2203.  
  2204.             Makes the floor and the ceiling meet by moving both.
  2205.  
  2206.     94:Pillar_BuildAndCrush / tag / speed / height / crush / arg5
  2207.         tag:        tag of affected sector
  2208.         speed:        speed of build
  2209.         height:     height (relative to floor) where floor meets ceiling
  2210.         crush:        damage from crushing
  2211.  
  2212.  
  2213.     Stair Specials
  2214.     --------------
  2215.     These stair building specials find the sector with 'tag' and
  2216.     build stairs by traversing adjacent sector marked with the
  2217.     StairSpecial1 and StairSpecial2.  These specials must alternate
  2218.     between the two and must not branch.
  2219.  
  2220.     26:Stairs_BuildDown / tag / speed / height / delay / reset
  2221.         tag:        tag of sector to start in
  2222.         speed:        speed of build [0.255]
  2223.         height:        height of step in pixels
  2224.         delay:        delay between steps in tics
  2225.         reset:      delay before stairs to reset (0==no reset)
  2226.  
  2227.     27:Stairs_BuildUp / tag / speed / height / delay / reset
  2228.         tag:        tag of sector to start in
  2229.         speed:        speed of build [0.255]
  2230.         height:        height of step in pixels
  2231.         delay:        delay between steps in tics
  2232.         reset:      delay before stairs to reset (0==no reset)
  2233.  
  2234.     31:Stairs_BuildDownSync / tag / speed / height / reset / arg5
  2235.         tag:        tag of sector to start in
  2236.         speed:        speed of build [0.255]
  2237.         height:        height of step in pixels
  2238.         reset:      delay before stairs to reset (0==no reset)
  2239.  
  2240.     32:Stairs_BuildUpSync / tag / speed / height / reset / arg5
  2241.         tag:        tag of sector to start in
  2242.  
  2243.                                                                     Page 41
  2244.  
  2245. HEXEN Specs v0.9                                                    Page 42
  2246.  
  2247.         speed:        speed of build [0.255]
  2248.         height:        height of step in pixels
  2249.         reset:      delay before stairs to reset (0==no reset)
  2250.  
  2251.  
  2252.     Door Specials
  2253.     -------------
  2254.     10:Door_Close / tag / speed / arg3 / arg4 / arg5
  2255.         tag:        tag of affected sector or zero if line is part of door
  2256.         speed:        speed of move
  2257.  
  2258.             Closes a door sector.
  2259.  
  2260.     11:Door_Open / tag / speed / arg3 / arg4 / arg5
  2261.         tag:        tag of affected sector or zero if line is part of door
  2262.         speed:        speed of move
  2263.  
  2264.             Opens a door sector.
  2265.  
  2266.     12:Door_Raise / tag / speed / delay / arg4 / arg5
  2267.         tag:        tag of affected sector or zero if line is part of door
  2268.         speed:        speed of move
  2269.         delay:        delay before door lowers
  2270.  
  2271.     13:Door_LockedRaise / tag / speed / delay / lock / arg5
  2272.         tag:        tag of affected sector or zero if line is part of door
  2273.         speed:        speed of move
  2274.         delay:        delay before door lowers
  2275.         lock:       key number that will unlock door (see key numbers)
  2276.  
  2277.             Raises a door if correct key is in inventory of triggering player.
  2278.  
  2279.  
  2280.     Script Specials
  2281.     ---------------
  2282.     80:ACS_Execute / script / map / s_arg1 / s_arg2 / s_arg3
  2283.         script:        script number to execute
  2284.         map:        map which contains the script
  2285.  
  2286.     81:ACS_Suspend / script / map / arg3 / arg4 / arg5
  2287.         script:        script number to suspend
  2288.         map:        map which contains the script
  2289.  
  2290.     82:ACS_Terminate / script / map / arg3 / arg4 / arg5
  2291.         script:        script number to suspend
  2292.         map:        map which contains the script
  2293.  
  2294.     83:ACS_LockedExecute / script / map / s_arg1 / s_arg2 / lock
  2295.         script:        script number to suspend
  2296.         map:        map which contains the script
  2297.  
  2298.                                                                     Page 42
  2299.  
  2300. HEXEN Specs v0.9                                                    Page 43
  2301.  
  2302.         lock:       key number needed to run script (see key numbers)
  2303.  
  2304.  
  2305.     Light Specials
  2306.     --------------
  2307.     110:Light_RaiseByValue / tag / value / arg3 / arg4 / arg5
  2308.         tag:        tag of affected sector
  2309.         value:        relative value of light level change
  2310.  
  2311.     111:Light_LowerByValue / tag / value / arg3 / arg4 / arg5
  2312.         tag:        tag of affected sector
  2313.         value:        relative value of light level change
  2314.  
  2315.     112:Light_ChangeToValue / tag / value / arg3 / arg4 / arg5
  2316.         tag:        tag of affected sector
  2317.         value:        absolute value of light level change
  2318.  
  2319.     113:Light_Fade / tag / value / tics / arg4 / arg5
  2320.         tag:        tag of affected sector
  2321.         value:        absolute value of light level change
  2322.         tics:        number of tics to fade to light level
  2323.  
  2324.     114:Light_Glow / tag / upper / lower / tics / arg5
  2325.         tag:        tag of affected sector
  2326.         upper:        brightest light level
  2327.         lower:        lowest light level
  2328.         tics:        number of tics between light changes
  2329.  
  2330.     115:Light_Flicker / tag / upper / lower / arg4 / arg5
  2331.         tag:        tag of affected sector
  2332.         upper:        brightest light level
  2333.         lower:        lowest light level
  2334.  
  2335.     116:Light_Strobe / tag / upper / lower / u-tics / l-tics
  2336.         tag:        tag of affected sector
  2337.         upper:        brightest light level
  2338.         lower:        lowest light level
  2339.         u-tics:        tics to stay at upper light level
  2340.         l-tics:        tics to stay at lower light level
  2341.  
  2342.  
  2343.     Miscellaneous Specials
  2344.     ----------------------
  2345.     121:Line_SetIdentification / line / arg2 / arg3 / arg4 / arg5
  2346.         line:        unique id of this line
  2347.  
  2348.             The script functions setlineblocking, setlinespecial, and
  2349.             setlinetexture use the ID specified here to identify lines.
  2350.  
  2351.     100:Scroll_Texture_Left / speed / arg2 / arg3 / arg4 / arg5
  2352.  
  2353.                                                                     Page 43
  2354.  
  2355. HEXEN Specs v0.9                                                    Page 44
  2356.  
  2357.     101:Scroll_Texture_Right / speed / arg2 / arg3 / arg4 / arg5
  2358.     102:Scroll_Texture_Up / speed / arg2 / arg3 / arg4 / arg5
  2359.     103:Scroll_Texture_Down / speed / arg2 / arg3 / arg4 / arg5
  2360.         speed:      speed of scroll in pixels
  2361.  
  2362.     129:UsePuzzleItem / item / script / s_arg1 / s_arg2 / s_arg3
  2363.         item:        item number needed to activate
  2364.         script:        script to run upon activation
  2365.  
  2366.             Runs a script upon use of appropriate puzzle item:
  2367.  
  2368.             0   ZZ_Skull
  2369.             1   ZZ_BigGem
  2370.             2   ZZ_GemRed
  2371.             3   ZZ_GemGreen1
  2372.             4   ZZ_GemGreen2
  2373.             5   ZZ_GemBlue1
  2374.             6   ZZ_GemBlue2
  2375.             7   ZZ_Book1
  2376.             8   ZZ_Book2
  2377.             9   ZZ_Skull2
  2378.             10  ZZ_FWeapon
  2379.             11  ZZ_CWeapon
  2380.             12  ZZ_MWeapon
  2381.             13  ZZ_Gear
  2382.             14  ZZ_Gear2
  2383.             15  ZZ_Gear3
  2384.             16  ZZ_Gear4
  2385.  
  2386.     140:Sector_ChangeSound / tag / sound / arg3 / arg4 /  arg5
  2387.         tag:        tag of sector to contain sound
  2388.         sound:        sound to be played - see sector sounds
  2389.  
  2390.     120:Earthquake / intensity / duration / damrad / tremrad / tid
  2391.         intensity:    strength of earthquake in richters [1..9]
  2392.         duration:    duration in tics [1..255]
  2393.         damrad:     radius of damage in 64x64 cells [0..255]
  2394.         tremrad:    radius of tremor in 64x64 cells [0..255]
  2395.         tid:        TID of map thing(s) for quake foci
  2396.  
  2397.             Creates an earthquake at all matching foci.
  2398.  
  2399.     74:Teleport_NewMap / map / position / arg3 / arg4 / arg5
  2400.         map:        map to teleport to
  2401.         position:   corresponds to destination player start spot arg0.
  2402.  
  2403.             Teleports the player to a new map and to the player start spot
  2404.             whose arg0 member matches 'position.'
  2405.  
  2406.     75:Teleport_EndGame / arg1 / arg2 / arg3 / arg4 / arg5
  2407.  
  2408.                                                                     Page 44
  2409.  
  2410. HEXEN Specs v0.9                                                    Page 45
  2411.  
  2412.         Ends game and runs finale script.
  2413.         In deathmatch, teleports to level 1.
  2414.  
  2415.     70:Teleport / tid / arg2 / arg3 / arg4 / arg5
  2416.         tid:        TID of destination
  2417.  
  2418.             Teleports triggering object to MapSpot with tid.
  2419.  
  2420.     71:Teleport_NoFog / tid / arg2 / arg3 / arg4 / arg5
  2421.         Same as teleport, but silent with no fog sprite.
  2422.  
  2423.  
  2424.     Thing Specials
  2425.     --------------
  2426.     72:ThrustThing / angle / distance / arg3 / arg4 / arg5
  2427.         angle:        byte angle to thrust [0..255]
  2428.         distance:    distance to thrust
  2429.  
  2430.     73:DamageThing / damage / arg2 / arg3 / arg4 / arg5
  2431.         damage:        amount of damage
  2432.  
  2433.     130:Thing_Activate / tid / arg2 / arg3 / arg4 / arg5
  2434.         tid:        TID of thing to activate (see activatable things)
  2435.  
  2436.     131:Thing_Deactivate / tid / arg2 / arg3 / arg4 / arg5
  2437.         tid:        TID of thing to deactivate (see deactivatable things)
  2438.  
  2439.     132:Thing_Remove / tid / arg2 / arg3 / arg4 / arg5
  2440.         tid:        TID of thing to remove
  2441.  
  2442.     133:Thing_Destroy / tid / arg2 / arg3 / arg4 / arg5
  2443.         tid:        TID of affected thing
  2444.  
  2445.             Puts thing into its death state.
  2446.  
  2447.     134:Thing_Projectile / tid / type / angle / speed / vspeed
  2448.         tid:        TID of spawn location
  2449.         type:       Type of thing to spawn (see spawnable things)
  2450.         angle:        byte angle of projectile
  2451.         speed:        speed of projectile
  2452.         vspeed:        vertical speed
  2453.  
  2454.             Spawns a projectile.
  2455.  
  2456.     136:Thing_ProjectileGravity / tid / type / angle / speed / vspeed
  2457.         tid:        TID of spawn location
  2458.         type:       Type of thing to spawn (see spawnable things)
  2459.         angle:        byte angle of projectile
  2460.         speed:        speed of projectile
  2461.         vspeed:        vertical speed
  2462.  
  2463.                                                                     Page 45
  2464.  
  2465. HEXEN Specs v0.9                                                    Page 46
  2466.  
  2467.  
  2468.             Spawns a projectile with gravity.
  2469.  
  2470.     135:Thing_Spawn / tid / type / angle / arg4 / arg5
  2471.         tid:        TID of spawn location
  2472.         type:       Type of thing to spawn (see spawnable things)
  2473.         angle:        byte angle of thing to face
  2474.  
  2475.             Spawns a thing.
  2476.  
  2477.     137:Thing_SpawnNoFog / tid / type / angle / arg4 / arg5
  2478.         tid:        TID of spawn location
  2479.         type:       Type of thing to spawn (see spawnable things)
  2480.         angle:        byte angle of projectile
  2481.  
  2482.             Spawns a thing silently.
  2483.  
  2484.  
  2485.     PolyObject Specials
  2486.     --------------------
  2487.     1:Polyobj_StartLine / po / mirror / sound / arg4 / arg5
  2488.         po:         refer to a particular polyobj
  2489.         mirror:     poly that will mirror the moves of this poly
  2490.         sound:        See Section 5:  Sector Sound
  2491.  
  2492.     2:Polyobj_RotateLeft / po / speed / angle / arg4 / arg5
  2493.         po:            polyobj
  2494.         speed:        speed
  2495.         angle:        byte angle to rotate
  2496.  
  2497.     3:Polyobj_RotateRight / po / speed / angle / arg4 / arg5
  2498.         po:            polyobj
  2499.         speed:        speed
  2500.         angle:        byte angle to rotate
  2501.  
  2502.     4:Polyobj_Move / po / speed / angle / distance / arg5
  2503.         po:            polyobj
  2504.         speed:        speed
  2505.         angle:        byte angle to move along
  2506.         distance:    byte distance to move
  2507.  
  2508.     5:Polyobj_ExplicitLine / po / order / mirror / sound / arg5
  2509.         po:            polyobj
  2510.         order:        rendering order of this line
  2511.         mirror:     poly that will mirror the moves of this poly
  2512.         sound:        See Section 5:  Sector Sound
  2513.  
  2514.     6:Polyobj_MoveTimes8 / po / speed / angle / distance / arg5
  2515.         po:            polyobj
  2516.         speed:        speed
  2517.  
  2518.                                                                     Page 46
  2519.  
  2520. HEXEN Specs v0.9                                                    Page 47
  2521.  
  2522.         angle:        byte angle
  2523.         distance:   byte distance to move in units of 8
  2524.  
  2525.     7:Polyobj_DoorSwing / po / speed / angle / delay / arg5
  2526.         po:            polyobj
  2527.         speed:        speed
  2528.         angle:        byte angle
  2529.         delay:        delay in tics
  2530.  
  2531.     8:Polyobj_DoorSlide / po / speed / angle / distance / delay
  2532.         po:            polyobj
  2533.         speed:        speed
  2534.         angle:        byte angle
  2535.         distance:    byte distance
  2536.         delay:        delay in tics
  2537.  
  2538.     90:Polyobj_OR_RotateLeft / po / speed / angle / arg4 / arg5
  2539.     91:Polyobj_OR_RotateRight / po / speed / angle / arg4 / arg5
  2540.     92:Polyobj_OR_Move / po / speed / angle / distance / arg5
  2541.     93:Polyobj_OR_MoveTimes8 / po / speed / angle / distance / arg5
  2542.  
  2543. The OR stands for OverRide.  As stated before, each poly can only be doing a
  2544. single action at a time.  This poses a problem with perpetual polyobjs, since
  2545. they are already moving, the designer cannot do anything else with them.
  2546. However, using these functions the designer can override the code to not
  2547. allow a poly to concurrently execute more than one action, and force a poly
  2548. to do the other action as well.
  2549.  
  2550.  
  2551.  
  2552.  
  2553.  
  2554.  
  2555.  
  2556.  
  2557.  
  2558.  
  2559.  
  2560.  
  2561.  
  2562.  
  2563.  
  2564.  
  2565.  
  2566.  
  2567.  
  2568.  
  2569.  
  2570.  
  2571.  
  2572.  
  2573.                                                                     Page 47
  2574.  
  2575. HEXEN Specs v0.9                                                    Page 48
  2576.  
  2577. ┌───┬─────────────────────────────────────────────────────────────────────
  2578. │ F │ Sector Sounds for ChangeSectorSound() special:
  2579. └───┘
  2580.  
  2581.     1    heavy
  2582.     2    metal
  2583.     3    creak
  2584.     4    silence
  2585.     5    lava
  2586.     6    water
  2587.     7    ice
  2588.     8    earth
  2589.     9    metal2
  2590.  
  2591.  
  2592.  
  2593.  
  2594.  
  2595.  
  2596.  
  2597.  
  2598.  
  2599.  
  2600.  
  2601.  
  2602.  
  2603.  
  2604.  
  2605.  
  2606.  
  2607.  
  2608.  
  2609.  
  2610.  
  2611.  
  2612.  
  2613.  
  2614.  
  2615.  
  2616.  
  2617.  
  2618.  
  2619.  
  2620.  
  2621.  
  2622.  
  2623.  
  2624.  
  2625.  
  2626.  
  2627.                                                                     Page 48
  2628.  
  2629. HEXEN Specs v0.9                                                    Page 49
  2630.  
  2631. ┌───┬─────────────────────────────────────────────────────────────────────
  2632. │ G │ Key Numbers
  2633. └───┘
  2634.  
  2635.     These are referenced by the DoorRaiseLocked() and ACS_ExecuteLocked()
  2636.     specials.
  2637.  
  2638.     1    steel key
  2639.     2    cave key
  2640.     3    axe key
  2641.     4    fire key
  2642.     5    emerald key
  2643.     6    dungeon key
  2644.     7    silver key
  2645.     8    rusted key
  2646.     9    horn key
  2647.     10  swamp key
  2648.     11  castle key
  2649.  
  2650.  
  2651.